package com.yuanian.wf.pojo.dto;


import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.Map;

public class BaseDto<T> {

    //流程标识
    protected String processKey;
    //业务数据
    protected T businessData;
    //执行变量数据
    protected Map<String, Object> variables = new HashMap<>();
    //按钮上的名称，即做的是啥操作，有可能为驳回，撤回，提交等等
    protected String act;

    //业务数据的主键,对应业务表的主键id，推荐使用雪花算法.在开启流程前设置
    protected String dataId;

    public String getDataId() {
        return dataId;
    }

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public Map<String, Object> getVariables() {
        return variables;
    }

    public void setVariables(Map<String, Object> variables) {
        this.variables = variables;
    }

    public String getProcessKey() {
        return processKey;
    }

    public void setProcessKey(String processKey) {
        this.processKey = processKey;
    }

    public T getBusinessData() {
        return businessData;
    }
    public T getBusinessData(Class<T> clz) {
        return JSONObject.parseObject(JSONObject.toJSONString(businessData), clz);
    }

    public void setBusinessData(T businessData) {
        this.businessData = businessData;
    }

    public String getAct() {
        return act;
    }

    public void setAct(String act) {
        this.act = act;
    }

}
